package server;

/**
 * @author 王瑞
 * @description:
 * @date 2020/3/1  16:17
 */
public class HttpProtocoUtil {

    public static String getHttpHeader200(long contentLength){

        String header200 = "HTTP/1.1 200 OK \n"+
                           "Content-Type: text/html \n"+
                            "Content-Length: "+contentLength+"\n"+
                            "\r\n";
        return header200;

    }

    public static String getHttpHeader404(){

        String content404 = "<h1>404 NOT FONT</h1>";

        String header404 = "HTTP/1.1 404 NOT FONT \n"+
                "Content-Type: text/html \n"+
                "Content-Length: "+content404.getBytes().length+"\n"+
                "\r\n" +content404;
        return header404;

    }

}
